﻿<%@ Page Language="C#" MasterPageFile="~/User/MasterPage.master" AutoEventWireup="true" CodeFile="userlogs.aspx.cs" Inherits="User_userlogs" Title="无标题页" %>

<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:CXDB %>" 
        SelectCommand="SELECT [username], [ip], [loginOK], [intime] FROM [CX_UserLogin] ORDER BY [intime] DESC"></asp:SqlDataSource>
    <ext:Store ID="Store1" DataSourceID="SqlDataSource1" runat="server">
        <Reader>
            <ext:JsonReader>
                <Fields>
                    <ext:RecordField Name="username"  Type="String"></ext:RecordField>
                    <ext:RecordField Name="ip" Type="String"></ext:RecordField>
                    <ext:RecordField Name="loginOK" Type="String"></ext:RecordField>
                    <ext:RecordField Name="intime" Type="String"></ext:RecordField>
                </Fields>
            </ext:JsonReader>
        </Reader>
        <AutoLoadParams>
         <ext:Parameter Name="start" Mode="Raw" Value="0" />
         <ext:Parameter Name="limit" Mode="raw" Value="25" />
     </AutoLoadParams>
    </ext:Store>
    <ext:GridPanel ID="GridPanel1" StoreID="Store1" AutoExpandColumn="loginOK" Frame="true" AutoHeight="true" AutoWidth="true" runat="server">
        <ColumnModel>
            <Columns>
                <ext:Column DataIndex="username" Header="用户名" ></ext:Column>
                <ext:Column DataIndex="ip" Header="登录IP"></ext:Column>
                <ext:Column DataIndex="loginOK" Header="登录情况"></ext:Column>
                <ext:Column DataIndex="intime" Width="200" Header="登录时间">
                <Renderer Fn="Ext.util.Format.dateRenderer('Y/m/d H:i:s')" />
                </ext:Column>
            </Columns>
        </ColumnModel>
        <BottomBar>
                        <ext:PagingToolBar 
                            ID="PagingToolBar1" 
                            runat="server" 
                            PageSize="20" 
                            StoreID="Store1" 
                            />
                    </BottomBar>
    </ext:GridPanel>
</asp:Content>

